#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: case02_cloud.py 
@version:
@time: 2022/04/14 
"""
from TapClientCaseData.CaseGenerateData import CGB
from TapClientCaseData.CaseGenerateData.case_generator.case_data_generate_base import *


class CaseGenerateCloud(CGB):
    CGB_SOURCE = read_yaml(path_joint(CASE_GENERATE_SOURCE, 'source_cloud.yml'))
    CGB_TARGET = read_yaml(path_joint(CASE_GENERATE_TARGET, 'target_cloud.yml'))
    CGB_STATS = CASE_GENERATE_STATS
    _CGBS_MYSQL = CGB_SOURCE.get('Mysql')
    _CGBS_MONGODB = CGB_SOURCE.get('MongoDB')
    _CGBS_POSTGRES = CGB_SOURCE.get('Postgres')
    _CGBS_ORACLE = CGB_SOURCE.get('Oracle')
    _CGBS_SQLSERVER = CGB_SOURCE.get('Sqlserver')
    _CGBS_ES = CGB_SOURCE.get('ES')
    _CGBS_DUMMY = CGB_SOURCE.get('Dummy')
    _CGBS_ACTIVEMQ = CGB_SOURCE.get('ActiveMQ')
    _CGBS_RABBITMQ = CGB_SOURCE.get('RabbitMQ')
    _CGBS_ROCKETMQ = CGB_SOURCE.get('RocketMQ')
    _CGBS_KAFKA = CGB_SOURCE.get('Kafka')
    _CGBS_DB2 = CGB_SOURCE.get('DB2')
    _CGBS_DAMENG = CGB_SOURCE.get('DM')
    _CGBS_KINGBASE = CGB_SOURCE.get('KingBaseES')
    _CGBS_MARIADB = CGB_SOURCE.get('Mariadb')
    _CGBS_KINGBASER3 = CGB_SOURCE.get('KingBaseR3')
    _CGBS_KINGBASER6 = CGB_SOURCE.get('KingBaseR6')
    CGBS_MYSQL = static_add_db_info_name(MYSQL_GENERATE_STATIC, _CGBS_MYSQL)
    CGBS_MONGODB = static_add_db_info_name(MONGODB_GENERATE_STATIC, _CGBS_MONGODB)
    CGBS_POSTGRES = static_add_db_info_name(POSTGRES_GENERATE_STATIC, _CGBS_POSTGRES)
    CGBS_ORACLE = static_add_db_info_name(ORACLE_GENERATE_STATIC, _CGBS_ORACLE)
    CGBS_SQLSERVER = static_add_db_info_name(SQLSERVER_GENERATE_STATIC, _CGBS_SQLSERVER)
    CGBS_ES = static_add_db_info_name(SQLSERVER_GENERATE_STATIC, _CGBS_ES)
    CGBS_DUMMY = static_add_db_info_name(DUMMY_GENERATE_STATIC, _CGBS_DUMMY)
    CGBS_ACTIVEMQ = static_add_db_info_name(MQ_GENERATE_STATIC, _CGBS_ACTIVEMQ)
    CGBS_RABBITMQ = static_add_db_info_name(MQ_GENERATE_STATIC, _CGBS_RABBITMQ)
    CGBS_ROCKETMQ = static_add_db_info_name(MQ_GENERATE_STATIC, _CGBS_ROCKETMQ)
    CGBS_KAFKA = static_add_db_info_name(KAFKA_GENERATE_STATIC, _CGBS_KAFKA)
    CGBS_DB2 = static_add_db_info_name(DB2_GENERATE_STATIC, _CGBS_DB2)
    CGBS_MARIADB = static_add_db_info_name(MYSQL_GENERATE_STATIC, _CGBS_MARIADB)
    CGBS_DAMENG = static_add_db_info_name(ORACLE_GENERATE_STATIC, _CGBS_DAMENG)
    CGBS_KINGBASER3 = static_add_db_info_name(ORACLE_GENERATE_STATIC, _CGBS_KINGBASER3)
    CGBS_KINGBASER6 = static_add_db_info_name(POSTGRES_GENERATE_STATIC, _CGBS_KINGBASER6)

    import db_info_cloud

    db_info_class = get_classes(db_info_cloud)

    dml_ddl_base = get_classes(base00_common)

    @property
    def cgb_source(self):
        return self._assemble_source()

    def cgb_dummy(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_DUMMY, case, _type)

    def cgb_activemq(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_ACTIVEMQ, case, _type)

    def cgb_rabbitmq(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_RABBITMQ, case, _type)

    def cgb_rocketmq(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_ROCKETMQ, case, _type)

    def cgb_dameng(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_DAMENG, case, _type)

    def cgb_kingbaser3(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_KINGBASER3, case, _type)

    def cgb_kingbaser6(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_KINGBASER6, case, _type)
